package sel.me.spring.boot159.web.extension.event;

import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;

/**
 * @author shenenlu 2021年03月05日 下午16:40:54
 */
@Component
public class EventPublisher implements ApplicationEventPublisherAware {

    @Override
    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        EmailEvent event = new EmailEvent("helloApplicationEventPublisherAware","boylmx@163.com","this is a email text!");
        applicationEventPublisher.publishEvent(event);
    }

}
